let fs = require('fs')
let arr = []

function fn(data){
  arr.push(data)
  if(arr.length == 2){
    console.log(arr);
  }
}

fs.readFile('./name.txt','utf-8', function(err, data){
  fn(data)
})

fs.readFile('./age.txt','utf-8', function(err, data){
  fn(data)
})
